import request from '@/utils/request'

// 工单列表
export function getTaskApi(pageNum, pageSize, otaTaskName) {
    return request({
        url: '/sys/ota/task',
        method: 'get',
        params: { pageNum, pageSize, otaTaskName }
    })
}
// 添加工单
export function addTaskApi(data) {
    return request({
        url: '/sys/ota/task',
        method: 'post',
        data
    })
}
// 获取硬件类别
export function getHardwareApi() {
    return request({
        url: '/sys/ota/task/hardware',
    })
}
// 获取版本ID
export function getVersionApi(hardwareId) {
    return request({
        url: `/sys/ota/task/version/${hardwareId}`,
    })
}
// 删除工单
export function delTaskApi(id) {
    return request({
        url: `/sys/ota/task/${id}`,
        method: 'delete'
    })
}
// 修改备注
export function editTaskApi(id, data) {
    return request({
        url: `/sys/ota/task/${id}`,
        method: 'put',
        data
    })
}
// 升级记录
export function upDateRecordApi(id, pageNum, pageSize, meterNum) {
    return request({
        url: `/sys/ota/task/${id}/ota`,
        params: { pageNum, pageSize, meterNum }
    })
}